import { IParam } from '@/core';
import { IBIZStorageServiceBase } from './ibiz-storage-service-base';

/**
 * 存储服务
 * 基于template/src/api/{{appEntities}}/data-service/{{appEntities}}-service.ts.hbs生成
 *
 * @export
 * @class IBIZStorageService
 * @extends IBIZStorageServiceBase
 */
export class IBIZStorageService extends IBIZStorageServiceBase {

    /**
     * 基础数据服务实例
     * 
     * @private
     * @type { IBIZStorageService }
     * @memberof IBIZStorageService
     */
    private static basicDataServiceInstance: IBIZStorageService;

    /**
     * 数据服务存储Map对象
     *
     * @private
     * @type {Map<string, any>}
     * @memberof IBIZStorageService
     */
    private static dataServiceMap: Map<string, any> = new Map();

    /**
     * Creates an instance of IBIZStorageService.
     * @memberof IBIZStorageService
     */
    constructor(opts?: IParam) {
        super(opts);
    }

    /**
     * 获取实例
     *
     * @static
     * @param 应用上下文
     * @return {*}  { IBIZStorageService }
     * @memberof IBIZStorageService
     */
    static getInstance(opts?: IParam): IBIZStorageService {
        if (!this.basicDataServiceInstance) {
            this.basicDataServiceInstance = new IBIZStorageService(opts);
        }
        return this.basicDataServiceInstance;
    }
}
export default IBIZStorageService;